{% extends 'index.html' %}
{% block title %}登陆{% endblock %}
{% block content %}
    <div class="post">
        <form class="form-horizontal" method="post" action="{% url 'login' %}">
            {% csrf_token %}
            <div class="form-group">
                <div style="text-align: center"><h2>用户登陆</h2></div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">用户名</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputEmail3" placeholder="Username" name="username">
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="inputPassword3" placeholder="Password" name="password">
                </div>
            </div>
            <div class="form-group list-inline">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary">登陆</button>
                    <span class="btn btn-link">没有账号?<a href="{% url 'register' %}" target="_blank">点击注册</a></span>
                </div>
            </div>
        </form>
        <span style="color: red">{{ login_err }}</span>
    </div>
{% endblock %}